//
//  MenuManager.swift
//  xcodesort-es
//
//  Created by 赵梁 on 2021/5/26.
//

import Foundation
import XcodeKit

protocol Navigator {
  func navigate(invocation: XCSourceEditorCommandInvocation)
  var title: String { get }
}

struct MenuManager {

  static let navigators: [Navigator] = [
    ObjcGraphNavigator(),
  ]

  static func find(commandIdentifier: String) -> Navigator? {
    for navigator in navigators {
        
      if Helper.namespacedIdentifier(identifier: navigator.title) == commandIdentifier {
        return navigator
      }
    }

    return nil
  }
}
